]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Ignore the allDay property of an event
authorSebastian Keller <skeller@gnome.org>
Thu, 4 Nov 2021 11:48:26 +0000 (12:48 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 30 Nov 2021 02:13:24 +0000 (02:13 +0000)
Given the correct end date this code would be able to determine this
correctly itself and doesn't need to rely on that property. And events
without correct end dates are currently not shown anyway. This prepares
for removing the allDay property entirely.

This also fixes events going from 13:00 the current day to 01:00 not
showing "...". It also fixes multi-day events wrongly detected as
all-day events by the calendar-server showing up as "All day", despite
only covering 1 hour of the day.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2023>

js/ui/dateMenu.js

index f235ba38a2dff252589d3341e01df7dceca32b6a..6edd790a05847dfad6d11aadc5e54c36dd395691 100644 (file)
@@ -170,8 +170,8 @@ class EventsSection extends St.Button {
     }
 
     _formatEventTime(event) {
-        const allDay = event.allDay ||
-            (event.date <= this._startDate && event.end >= this._endDate);
+        const allDay =
+            event.date <= this._startDate && event.end >= this._endDate;
 
         let title;
         if (allDay) {
@@ -185,13 +185,13 @@ class EventsSection extends St.Button {
         }
 
         const rtl = Clutter.get_default_text_direction() === Clutter.TextDirection.RTL;
-        if (event.date < this._startDate && !event.allDay) {
+        if (event.date < this._startDate) {
             if (rtl)
                 title = '%s%s'.format(title, ELLIPSIS_CHAR);
             else
                 title = '%s%s'.format(ELLIPSIS_CHAR, title);
         }
-        if (event.end > this._endDate && !event.allDay) {
+        if (event.end > this._endDate) {
             if (rtl)
                 title = '%s%s'.format(ELLIPSIS_CHAR, title);
             else